import { Controller, Get, UseGuards } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { Roles } from 'src/decorator';
import { UserService } from './user.service';
import { RoleGuard } from '../guard';

@Controller('users')
export class UserController {
  constructor(private readonly usersService: UserService) {}

  @UseGuards(AuthGuard('jwt'), RoleGuard)
  @Get('number')
  @Roles('admin')
  getNumber() {
    return this.usersService.getNumber();
  }
}
